﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GuiClient.DTO;

namespace GuiClient
{
    public partial class UserControlFormDangNhap : UserControl
    {      

        public UserControlFormDangNhap()
        {
            InitializeComponent();
        }

        public string getMaThe()
        {
            return this.textBoxMaThe.Text;
        }
        public string getMaPin()
        {
            return this.textBoxMaPin.Text;
        }

        public delegate void DangNhap(DangNhapDTO info);
        public event DangNhap DangNhapEvent;

        private void buttonDangNhap_Click(object sender, EventArgs e)
        {
            DangNhapDTO DangNhapDTO = new DangNhapDTO();
            DangNhapDTO.MaThe = this.textBoxMaThe.Text;
            DangNhapDTO.MaPin = this.textBoxMaPin.Text;
            if (DangNhapEvent != null)
            {
                DangNhapEvent(DangNhapDTO);
            }
        }

        public void ResetGui()
        {
            this.textBoxMaPin.Text = "";
            this.textBoxMaThe.Text = "";
        }

        private void UserControlFormDangNhap_Load(object sender, EventArgs e)
        {

        }
    }
}
